<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div>number 1<button onclick="downloadW('111')">get</button></div>
  <div>number 2<button onclick="downloadW('222')">get</button></div>
  <div>number 3<button onclick="downloadW('333')">get</button></div>
  <div id="text">text</div>
</body>
</html>

<script>

window.onScriptableMessage = (rr) => {
    console.log('receive')
     console.log(rr); //Data from scriptable
     document.getElementById('text').innerHTML = rr.toString()
};

  const data = 123

  function callback() {
    // return window.data.callback   
  }

  async function subscribe() {

    // console.log(window.data.event)

    return data
    // return {
    //     aaa: '123123'
    // }
  }

  function downloadW(e) {
      console.log(e)
      completion(e)
    //   window.data = e
    //   const aaa = window.data.event()
    //   console.log(aaa)
    // window.data.event(e)
  }


</script>